﻿using System;
using System.Web.Mvc;

namespace Wikey.Utilities.Extensions
{
    public static class HtmlHelperExtensions
    {
        public static string Render<T>( this HtmlHelper<T> helper , string linkText , string controller , string action , string param) where T : class
        {
            return String.Format(
                "<a href='{1}/{2}/{3}'>{0}</a>", linkText, controller, action, param
                );
        }

        public static string Render<T>(this HtmlHelper<T> helper, string linkText, string controller,string param) where T : class
        {
            //dirty dirty!
            string path = helper.ViewContext.HttpContext.Request.Url.Authority;

            
            return String.Format(
                "<a href='http://{0}/{1}/{2}'>{3}</a>", path , controller, param ,linkText
                );
        }
    }
}
